Optimal. Leaf size=40 \[ a^2 x+\frac{b (2 a+b) \tan (e+f x)}{f}+\frac{b^2 \tan ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0294881, antiderivative size = 40, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {4128, 390, 203} \[ a^2 x+\frac{b (2 a+b) \tan (e+f x)}{f}+\frac{b^2 \tan ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4128
Rule 390
Rule 203
Rubi steps
\begin{align*} \int \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b+b x^2\right )^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (b (2 a+b)+b^2 x^2+\frac{a^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{b (2 a+b) \tan (e+f x)}{f}+\frac{b^2 \tan ^3(e+f x)}{3 f}+\frac{a^2 \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=a^2 x+\frac{b (2 a+b) \tan (e+f x)}{f}+\frac{b^2 \tan ^3(e+f x)}{3 f}\\ \end{align*}
Mathematica [B] time = 0.397328, size = 106, normalized size = 2.65 \[ \frac{4 \sec ^3(e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (3 a^2 f x \cos ^3(e+f x)+2 b (3 a+b) \sec (e) \sin (f x) \cos ^2(e+f x)+b^2 \tan (e) \cos (e+f x)+b^2 \sec (e) \sin (f x)\right )}{3 f (a \cos (2 (e+f x))+a+2 b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.038, size = 48, normalized size = 1.2 \begin{align*}{\frac{1}{f} \left ({a}^{2} \left ( fx+e \right ) +2\,ab\tan \left ( fx+e \right ) -{b}^{2} \left ( -{\frac{2}{3}}-{\frac{ \left ( \sec \left ( fx+e \right ) \right ) ^{2}}{3}} \right ) \tan \left ( fx+e \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.01899, size = 59, normalized size = 1.48 \begin{align*} a^{2} x + \frac{{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} b^{2}}{3 \, f} + \frac{2 \, a b \tan \left (f x + e\right )}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.482485, size = 142, normalized size = 3.55 \begin{align*} \frac{3 \, a^{2} f x \cos \left (f x + e\right )^{3} +{\left (2 \,{\left (3 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}\right )} \sin \left (f x + e\right )}{3 \, f \cos \left (f x + e\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.32292, size = 72, normalized size = 1.8 \begin{align*} \frac{b^{2} \tan \left (f x + e\right )^{3} + 3 \,{\left (f x + e\right )} a^{2} + 6 \, a b \tan \left (f x + e\right ) + 3 \, b^{2} \tan \left (f x + e\right )}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]